home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / termios.h < prev    next >
C/C++ Source or Header  |  1991-04-09  |  3KB  |  151 lines

  1. /*
  2.  * termios.h --
  3.  *
  4.  *    Declarations of structures and flags for controlling the `termio'
  5.  *      general terminal interface.
  6.  *
  7.  * Copyright 1989 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/lib/include/sys/RCS/termios.h,v 1.2 91/03/29 18:06:51 shirriff Exp $
  17.  */
  18.  
  19. #ifndef _TERMIOS_
  20. #define _TERMIOS_
  21.  
  22. /*
  23.  * input flag bits
  24.  */
  25. #define    IGNBRK    0x00000001
  26. #define    BRKINT    0x00000002
  27. #define    IGNPAR    0x00000004
  28. #define    PARMRK    0x00000008
  29. #define    INPCK    0x00000010
  30. #define    ISTRIP    0x00000020
  31. #define    INLCR    0x00000040
  32. #define    IGNCR    0x00000080
  33. #define    ICRNL    0x00000100
  34. #define    IUCLC    0x00000200
  35. #define    IXON    0x00000400
  36. #define    IXANY    0x00000800
  37. #define    IXOFF    0x00001000
  38. #define    IMAXBEL    0x00002000
  39.  
  40. /*
  41.  * output flag bits
  42.  */
  43. #define    OPOST    0x00000001
  44. #define    OLCUC    0x00000002
  45. #define    ONLCR    0x00000004
  46. #define    OCRNL    0x00000008
  47. #define    ONOCR    0x00000010
  48. #define    ONLRET    0x00000020
  49. #define    OFILL    0x00000040
  50. #define    OFDEL    0x00000080
  51. #define    NLDLY    0x00000100
  52. #define    CRDLY    0x00000600
  53. #define    TABDLY    0x00001800
  54. #define    TAB3    XTABS
  55. #define    BSDLY    0x00002000
  56. #define    VTDLY    0x00004000
  57. #define    VT0    0
  58. #define    VT1    0x00004000
  59. #define    FFDLY    0x00008000
  60. #define    PAGEOUT    0x00010000
  61. #define    WRAP    0x00020000
  62.  
  63. /*
  64.  * control flag bits
  65.  */
  66. #define    CBAUD    0x0000000f
  67. #define    CSIZE    0x00000030
  68. #define    CS5    0
  69. #define    CS6    0x00000010
  70. #define    CS7    0x00000020
  71. #define    CS8    0x00000030
  72. #define    CSTOPB    0x00000040
  73. #define    CREAD    0x00000080
  74. #define    PARENB    0x00000100
  75. #define    PARODD    0x00000200
  76. #define    HUPCL    0x00000400
  77. #define    CLOCAL    0x00000800
  78. #define    LOBLK    0x00001000
  79. #define    CIBAUD    0x000f0000
  80. #define    CRTSCTS    0x80000000
  81.  
  82. #define    IBSHIFT    16
  83.  
  84. /*
  85.  * line discipline flag bits
  86.  */
  87. #define    ISIG    0x00000001
  88. #define    ICANON    0x00000002
  89. #define    XCASE    0x00000004
  90. #define    ECHOE    0x00000010
  91. #define    ECHOK    0x00000020
  92. #define    ECHONL    0x00000040
  93. #define    ECHOCTL    0x00000200
  94. #define    ECHOPRT    0x00000400
  95. #define    ECHOKE    0x00000800
  96. #define    DEFECHO    0x00001000
  97. #define IEXTEN    0x00008000
  98.  
  99.  
  100. /*
  101.  * control characters
  102.  */
  103. #define    VINTR        0
  104. #define    VQUIT        1
  105. #define    VERASE        2
  106. #define    VKILL        3
  107. #define    VEOF        4
  108. #define    VMIN        VEOF
  109. #define    VEOL        5
  110. #define    VTIME        VEOL
  111. #define    VEOL2        6
  112. #define    VSWTCH        7
  113. #define    VSTART        8
  114. #define    VSTOP        9
  115. #define    VSUSP        10
  116. #define    VDSUSP        11
  117. #define    VREPRINT    12
  118. #define    VDISCARD    13
  119. #define    VWERASE        14
  120. #define    VLNEXT        15
  121. #define    VSTATUS        16
  122.  
  123. /*
  124.  * codes 1-5 are used for obsolete calls
  125.  */
  126. #define    TCXONC        _IO('T', 6)
  127. #define    TCFLSH        _IO('T', 7)
  128. #define    TCGETS        _IOR('T', 8, struct termios)
  129. #define    TCSETS        _IOW('T', 9, struct termios)
  130. #define    TCSETSW        _IOW('T', 10, struct termios)
  131. #define    TCSETSF        _IOW('T', 11, struct termios)
  132. #define    TCSNDBRK    _IO('T', 12)
  133. #define    TCDRAIN        _IO('T', 13)
  134.  
  135. #define    NCCS    17
  136.  
  137. /*
  138.  * Ioctl control packet
  139.  */
  140. struct termios {
  141.     unsigned long    c_iflag;    /* input */
  142.     unsigned long    c_oflag;    /* output */
  143.     unsigned long    c_cflag;    /* control */
  144.     unsigned long    c_lflag;    /* line discipline */
  145.     char        c_line;        /* line discipline number */
  146.     unsigned char    c_cc[NCCS];    /* control characters */
  147. };
  148.  
  149. #endif /* _TERMIOS */
  150.  
  151.